/*
 * @Author: 黑白灰01 3193273703@qq.com
 * @Date: 2025-09-10 09:53:49
 * @LastEditors: 黑白灰01 3193273703@qq.com
 * @LastEditTime: 2025-09-10 11:04:33
 * @FilePath: /auth/src/app.module.ts
 * @Description: 
 * 
 * Copyright (c) 2025 by 3193273703@qq.com, All Rights Reserved. 
 */


import { Module } from '@nestjs/common';
import { APP_FILTER } from '@nestjs/core';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { UserModule } from './user/user.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { User } from './user/entities/user.entity';
import { HttpExceptionFilter } from './core/filter/http-exception/http-exception.filter';

@Module({
  imports: [UserModule,
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: 'localhost',
      port: 3306,
      username: 'root',
      password: '123456',
      database: 'nest_db',
      entities: [User],
      synchronize: true,
    }),
  ],
  controllers: [AppController],
  providers: [
    AppService,
    {
      provide: APP_FILTER,
      useClass: HttpExceptionFilter,
    },
  ],
})
export class AppModule {}